<form id="qouteForm" method="post" action="#" class="form form-horizontal">
	<?php if($products): ?>
		<h3><?php echo translate("products"); ?></h3>
		<?php foreach($products as $product): ?>
			<input type="hidden" name="products[]" value="<?php echo $product["id"]; ?>" />
			<div class="product">
				<div class="productImage">
					<a href="#" title="">
						<img src="<?php echo scripts_url() . $product["images"][0]["thumb_name"]; ?>" />
					</a>
				</div>
				<div class="productDetails">
					<a target="_blank" href="<?php echo $product["url"]; ?>" title="<?php echo $product["name"]; ?>">
						<?php echo $product["name"]; ?>
					</a>
					<p>
					<?php echo summarize_description($product["description"], 100); ?>
					</p>
				</div>
				<div class="productPrice"><?php echo $product["price"]; ?></div>
				<div class="properties">
				<?php foreach($product["properties"] as $property): ?>
					<ul class="propertyList">
						<li>
							<?php 
								echo $property["name"];
								
								$addClass = "";
								if($property["type"] == 2){
									$addClass = "colorList";
								} 
							?>
							
							<ul class="<?php echo $addClass; ?>">
								<li>
									<?php foreach($property["values"] as $propertyValue): ?>
										<a title="<?php echo $propertyValue["name"]; ?>" 
											style="<?php echo ($property["type"] == 2 ? "background:#".$propertyValue["value"] : ""); ?>">
											<?php echo $propertyValue["value"]; ?>
										</a>
									<?php endforeach; ?>
								</li>
							</ul>
						</li>
					</ul>
				<?php endforeach; ?>
				</div>
			</div>
		<?php endforeach;?>
		
		<div class="clearfix"></div>
	<?php elseif($bestCategory != false): ?>
		
		<?php $selectedCategory = false; ?>
		<div class="form-group">
  			<label for="category_id"><?php echo translate("category"); ?></label>
  			<select class="form-control" name="category_id">
  				<option value="0">---------</option>
	  			<?php foreach($categories as $super_cat): ?>
	  				<?php if($super_cat["id"] == $superCategory["id"]): ?>
	  					<?php foreach($super_cat["children"] as $child): ?>
	  						<?php
	  							$selected = "";
								if(isset($category["id"]) && $category["id"] == $child["id"])
								{
									$selected = "selected='selected'";
									$selectedCategory = $child;
								}
	  						?>
	  						<option value="<?php echo $child["id"]?>" <?php echo $selected; ?> ><?php echo $child["name"]; ?></option>
	  					<?php endforeach; ?>
	  				<?php endif; ?>
	  			<?php endforeach; ?>
  			</select>
		</div>
		
		<div class="form-group">
  			<label for="category_id"><?php echo translate("sub_category"); ?></label>
				<select class="form-control" name="subcategory_id" <?php echo ($selectedCategory ? "" : "disabled")?> >
					<option value="0">---------</option>
					<?php
						if($selectedCategory)
						{
							foreach($selectedCategory["children"] as $child)
							{
								$selected = "";
								if(isset($subCategory["id"]) && $subCategory["id"] == $child["id"])
								{
									$selected = "selected='selected'";
								}
								?>
								<option value="<?php echo $child["id"]?>" <?php echo $selected; ?> ><?php echo $child["name"]; ?></option>
								<?php
							}
						}
					?>
				</select>
		</div>
		
	<?php endif;?>
	
	<div class="form-group">
  		<label for="comment"><?php echo translate("observations"); ?></label>
	    <textarea placeholder="<?php echo translate("observations"); ?>" class="form-control" name="observations" id="observations"></textarea>
  	</div>
</form>